import { myPost } from '@/util/request'
import { API_SERVER } from '../service'

const DEFAULT_API = `${API_SERVER}/v2`

/**
 * @desc Plugin列表
 */
export const listPlugin = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/index`, data)
}

/**
 * @desc 新增Plugin
 */
export const createPlugin = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/save`, data)
}

/**
 * @desc 编辑Plugin
 */
export const updatePlugin = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/edit`, data)
}

/**
 * @desc 删除Plugin
 */
export const deletePlugin = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/delete`, data)
}

/**
 * @desc Plugin详情
 */
export const detailPlugin = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/detail`, data)
}

/**
 * @desc Plugin查询工作流-智能体
 */
export const listAgentflow = (data) => {
  return myPost(`${DEFAULT_API}/plugin/info/find/agentflow`, data)
}
